﻿<UserControl x:Class="PurchaseSales.Manage.Views.UserControls.AddCommodity"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:inf="clr-namespace:PurchaseSales.Manage.Common.Validates">
    <StackPanel>
        <TextBlock Text="编号："/>
        <TextBox x:Name="Element_Number" Text="{Binding Entity.Number, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock  Text="名称："/>
        <TextBox x:Name="Element_Name" Text="{Binding Entity.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock Text="商品类型："/>
        <TextBox Text="{Binding Entity.CommodityType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock Text="条形码："/>
        <TextBox Text="{Binding Entity.BarCode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock Text="单价："/>
        <TextBox Text="{Binding Entity.PresalePrice, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock Text="单位："/>
        <TextBox Text="{Binding Entity.Unit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock Text="数量："/>
        <TextBox Text="{Binding Entity.Count, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <TextBlock Text="描述："/>
        <TextBox Text="{Binding Entity.Remark, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

        <inf:RequiredValidator Property="{Binding Text,ElementName=Element_Number}"
                                  TriggerElement="{Binding ElementName=Element_Number}"/>
        <inf:RequiredValidator Property="{Binding Text,ElementName=Element_Name}"
                                  TriggerElement="{Binding ElementName=Element_Name}"/>
    </StackPanel>
</UserControl>
